<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>不定图片尺寸</title>
    <style>
        /* 
        辅助元素 -  i
        利用vertical-align: 
        1.主体元素inline-block
        2.宽度0 height:100% 
        3.vertical-align:middle
        */
        img {
            display: inline-block;
            vertical-align: middle;
        }

        i {
            display: inline-block;
            width: 0;
            height: 100%;
            vertical-align: middle;
        }
    </style>
</head>

<body>
    <p style="height:600px;background-color: #ccc;text-align: center;">
        <img src="https://img13.360buyimg.com/seckillcms/s144x144_jfs/t1/128799/13/5545/101979/5ef420b7E585803b0/9f15718226773f80.jpg!q70.jpg.webp"
            alt="">
        <!-- 辅助元素 -->
        <i></i>
    </p>

</body>

</html>